/**
 * Professor class.
 *
 * Class that defines objects of the Professor type, extends Person.
 *
 */

package com.dekaru.misc.person;

public class Professor extends Person {
	
	private int idNumber;
	private double salary;
	
	/**
	 * Professor empty constructor.
	 *
	 * Constructor to create a Professor object using default values.
	 *
	 */
	public Professor() {
	
		idNumber = 0;
		salary = 0d;	
	}

	/**
	 * Professor constructor.
	 *
	 * Constructor to create a Professor object using the given parameters.
	 *
	 * @param name String, idNumber integer, salary double.
	 *
	 */
	public Professor(String name, int idNumber, double salary) {
	
		super(name);
		this.idNumber = idNumber;
		this.salary = salary;	
	}
	
	/**
	 * getIdNumber method.
	 *
	 * Method to get the IdNumber of a Professor.
	 *
	 * @return idNumber integer.
	 *
	 */	
	public int getIdNumber() {
	
		return idNumber;	
	}

	/**
	 * getSalary method.
	 *
	 * Method to get the salary of a Professor.
	 *
	 * @return salary double.
	 *
	 */	
	public double getSalary() {
		
		return salary;
	}

	/**
	 * setIdNumber method.
	 *
	 * Method to set the IdNumber of a Person.
	 *
	 * @param idNumber integer.
	 *
	 */
	public void setIdNumber(int idNumber) {
		
		this.idNumber = idNumber;
	}

	/**
	 * setSalary method.
	 *
	 * Method to set the salary of a Person.
	 *
	 * @param salary double.
	 *
	 */
	public void setSalary(double salary) {
		
		this.salary = salary;
	}
	
	/**
	 * toString method.
	 *
	 * Method to display the data of a Professor.
	 *
	 * @return a String with the data of a Professor. 
	 *
	 */
	public String toString() {
		
		return getIdNumber() + " " + getName() + " " + getSalary();
	}

	/**
	 * equals method.
	 *
	 * Method that checks if the object received as parameter is exactly the same as the Professor created.
	 *
	 * @return true if objects are the same, false if they are different.
	 *
	 */	
	public boolean equals(Professor obj) {
		
		return ( (getIdNumber() == obj.getIdNumber()) && (getName().equals(obj.getName())) && (getSalary() == obj.getSalary()) );
	}
}